/*
let tpl = "Hello, {{ name }}!"
let data = { name: "John Doe" }
$.template(tpl, data)
*/


const loadsh_tpl = (tpl, data) => {
	var templateSettings = {
	  interpolate: /\{\{(.+?)\}\}/g
	};

	templateSettings = {
	  interpolate: /\{(.+?)\}/g
	};

	var template = _.template(tpl, templateSettings);
	var result = template(data);
	return result
	// result 将是 "Hello, John Doe!"	
}

const hbs_tpl = (tpl, data) => {
  // compile the template
  var template = Handlebars.compile(tpl);
  // execute the compiled template and print the output to the console

  const ret = template(data)

  console.log('hbs_tpl', tpl);
  console.log('hbs_tpl ret', ret);

  return ret
}

export const template = (tpl, data)=>{
	return hbs_tpl(tpl, data)
}